#ifndef STX_ALGORITHM_GENERATE_N_HPP
#define STX_ALGORITHM_GENERATE_N_HPP

#include <stx/algorithm/common.hpp>

namespace stx {

template <class OutputIterator, class Size, class _Generator>
inline OutputIterator
generate_n(OutputIterator first, Size n, _Generator gen)
{
    for (; n > 0; ++first, --n) {
        *first = gen();
    }
    return first;
}

} // namespace stx

#endif // STX_ALGORITHM_GENERATE_N_HPP
